<include file="public/layout"/>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>矿机设置</h3>
                <h5>矿场规则设置</h5>
            </div>
            <ul class="tab-base nc-row">
                <foreach name="group_list" item="v" key="k">
                    <li><a href="{:U('World.World/system',['inc_type'=> $k])}" <if condition="$k==$inc_type">class="current"</if>><span>{$v}</span></a></li>
                </foreach>
            </ul>
        </div>
    </div>
    <!-- 操作说明 -->
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom"><i class="fa fa-lightbulb-o"></i>
            <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
            <span id="explanationZoom" title="收起提示"></span></div>
        <ul>
            <li>切不可频繁更改</li>
        </ul>
    </div>
    <form method="post" enctype="multipart/form-data" name="form1" action="{:U('World.World/handle')}">
        <input type="hidden" name="inc_type" value="{$inc_type}">
        <div class="ncap-form-default">

            <dl class="row">
                <dt class="tit">
                    <label for="oil_num">油滴数量：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" pattern="^\d{1,}$" id="oil_num" name="oil_num" value="{$config.oil_num|default=0}" class="input-txt" type="text">个
                    <span class="err">只能输入整数</span>
                    <p class="notic">矿场显示油滴的数量</p>
                </dd>
            </dl>

            <dl class="row">
                <dt class="tit">
                    <label for="oil_num_float">油滴值浮动比例：</label>
                </dt>
                <dd class="opt">
                    <input onKeyUp="this.value=this.value.replace(/[^\d.]/g,'')" onpaste="this.value=this.value.replace(/[^\d.]/g,'')" pattern="^\d{1,}$" id="oil_num_float" name="oil_num_float" value="{$config.oil_num_float|default=0}" class="input-txt" type="text">
                    %
                    <span class="err">只能输入整数</span>
                     <p class="notic">每个油滴的数值以平均值为基准，取该比例为数值浮动率</p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="check_form()">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">

</script>
<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>
</body>
<script>
    function check_form(){
        var oil_num = $('input[name=oil_num]').val();
        var oil_min = $('input[name=oil_min]').val();
        var oil_max = $('input[name=oil_max]').val();

        var error ='';
        if(oil_num<1){
            error += "矿场显示油滴数不能小于1个\n<br>";
        }
        if(oil_num>8){
            error += "矿场显示油滴数不能大于8个\n<br>";
        }
        if(oil_min>=oil_max){
            error += "油滴最低值必须小于油滴最高值\n";
        }
        if(error){
            layer.alert(error, {icon: 2});  //alert(error);
            return false;
        }
        document.form1.submit();
    }

</script>
</html>